int control; //input in ASC

void setup(){
  
  Serial.begin(9600);
  pinMode(9,OUTPUT);    //LED1 as output
  pinMode(10,OUTPUT);   //LED2 as output
  pinMode(11,INPUT);    //Car as input 

}

void loop(){

  if (Serial.available() > 0) {
    if(digitalRead(11)==HIGH)    //if every door are close
      control=Serial.read();     //read input from Serial Monitor
  
  switch(control){
    case 76:                     //if the input = L (Door lock)
      digitalWrite(9, HIGH);     //LED1 turn on
      digitalWrite(10, HIGH);    //LED2 turn on
      delay(1000);               //Wait 1 sec
      digitalWrite(10, LOW);     //LED2 turn off
      break;
      
    case 85:                     //if the input is U (Unlock door)
      digitalWrite(9, LOW);      //LED1 turn off
      digitalWrite(10, HIGH);    //LED2 turn on for 1 sec (twice)
      delay(1000);               //Wait 1 sec
      digitalWrite(10, LOW);     //LED2 turn off
      delay(1000);               //Wait 1 sec
      digitalWrite(10, HIGH);    //LED2 turn on
      delay(1000);               //Wait 1 sec
      digitalWrite(10, LOW);     //LED2 turn off
      break;
  }
    }
    
    else                        //At least one door is open 
    digitalWrite(9, LOW);       //LED1 turn off
    digitalWrite(10, LOW);      //LED2 turn off
      
    }
  





